<template>
    <view>
        <!-- <block>
            <uni-col :span="12">
                <view class="demo-uni-col dark"></view>
            </uni-col>
			<uni-col :span="12">
                <view class="demo-uni-col light"></view>
            </uni-col>
        </block>
        <block>
            一个好康的图片甚么的
        </block>
        <block>
            一个用来输入数据的表单
        </block> -->
        <view>申请看房组件</view>
        <view class="uni-flex uni-column">
            <view class="part-one">
                <view class="heading">看房申请</view>
            </view>
            <view class="part-tow">
                <text>申请时间:{{getdate()}}</text>
            </view>
            <view class="part-three">
                <view v-if="housetype == 0">
                    <sellhouselist :sell="sell"></sellhouselist>
                </view>
                <view v-else>
                    <sellhouselist :rent="rent"></sellhouselist>
                </view>
            </view>
            <view class="uni-flex uni-row">
                <button class="agree">通过</button>
                <button class = "refuse">拒绝</button>
            </view>
        </view>
    </view>
</template>

<script>
import rentinglist from './rentinglist.vue'
import sellhouselist from './sellhouselist.vue'
    export default {
        // name: "house_sell"
        data(){
            return {
                applytime: 1472048779952,
                housetype: 1,
                rent:{
                    houseSurfaceplot:'../../static/facephoto/1.jpg',
                    rentingHeading:'sadfsdfasdf',
                    houseCity
                },
                sell:{
                    
                }
            }
        },
        methods: {
            getdate() {
                var now = new Date(this.applytime),
                    y = now.getFullYear(),
                    m = now.getMonth() + 1,
                    d = now.getDate();
                // return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8);
                return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
            },
            getHouse() {

            }
        },
        components:{
            rentinglist,
            sellhouselist
        }
    }
</script>

<style>
    .part-one{
        height: 20%;
        width: 100%;
        background-color: rgb(185, 185, 185);
    }

    .heading{
        font-size: 120%;
        text-align: center;
    }

    .part-tow{
        height: 40%;
        width: 100%;
        background-color: rgb(185, 185, 185);
    }

    .part-three{
        height: 60%;
        width: 100%;
        background-color: rgb(185, 185, 185);
    }

    .part-four{
        height: 40%;
        width: 100%;
        background-color: rgb(185, 185, 185);
    }

    .agree{
        color: rgb(255, 255, 255);
        font-size: 120%;
        background-color: green;
        width: 50%;
    }

    .refuse{
        color: rgb(255, 255, 255);
        font-size: 120%;
        background-color: red;
        width: 50%
    }
</style>
